package com.aerotechnic.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.codehaus.jackson.annotate.JsonProperty;

@Entity
@Table(name = "Mecanicien")
public class Mecanicien extends Personne {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	// sa specialite
	@Column(name = "Specialite")
	private String specialite;

	// ***********links*************

	// son leader
	
//	@OneToOne(fetch = FetchType.EAGER, targetEntity = Mecanicien.class)
	@Column(name = "leader")
	private int leader;

	// getter and setters
	@JsonProperty("Specialite")
	public String getSpecialite() {
		return specialite;
	}

	public void setSpec(String spec) {
		this.specialite = spec;
	}

	@JsonProperty("Leader")
	public int getLeader() {
		return leader;
	}

	public void setLeader(int leader) {
		this.leader = leader;
	}

	@Override
	public String toString() {
		return "Mecanicien [specialite=" + specialite + ", leader=" + leader
				+ ", nom=" + nom + ", prenom=" + prenom + ", id=" + id + "]";
	}

}
